



//  #include "rtc_calendar.h"



#ifndef __RTC_CALENDAR_H__
#define __RTC_CALENDAR_H__

#include <stdint.h>

//#define  RTC_Write     HC32_RTC_Write
//#define  RTC_Read      HC32_RTC_Read

/**
 * @defgroup RTC_Weekday RTC Weekday
 * @{
 */
#define RTC_WEEKDAY_SUNDAY                      (0x00U)
#define RTC_WEEKDAY_MONDAY                      (0x01U)
#define RTC_WEEKDAY_TUESDAY                     (0x02U)
#define RTC_WEEKDAY_WEDNESDAY                   (0x03U)
#define RTC_WEEKDAY_THURSDAY                    (0x04U)
#define RTC_WEEKDAY_FRIDAY                      (0x05U)
#define RTC_WEEKDAY_SATURDAY                    (0x06U)



#pragma pack(1)

typedef struct{
	
    uint8_t ucSecond;           //[00]
    uint8_t ucMinute;           //[01]
    uint8_t ucHour;             //[02]
    uint8_t ucWeek;              //[03]星期[0~6] ucDay  0表示星期天
    uint8_t ucDate;             //[04]日期
    uint8_t ucMonth;            //[05]
    uint8_t ucYear;             //[06]---从2000年开始的偏移量
	
}  RTC_Data_st;


#pragma pack()



 extern  RTC_Data_st   RTC_Now; 

 extern  uint8_t u8SecIntFlag ;


void RTC_Write(RTC_Data_st* rtc_new );
void RTC_Read(RTC_Data_st* rtc_new );


void RTC_Process(void);

void RTC_Prinft(RTC_Data_st* rtc );
void RTC_Prinft_Now(void);

uint64_t RTC_get_timestamp(void) ;    
int32_t RTC_set_timestamp(uint64_t timestamp_new);


int32_t  RTC_set_timezone(int8_t timezone);
int32_t  RTC_get_timezone( void );



#endif /* __HC32_RTC_CALENDAR_H__ */


/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
















